﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Profile;
using System.Data;
using System.Web.Security;
using System.Text;


namespace WebSite.cn
{
    public partial class userinfo : BasePage
    {

        public StringBuilder StrMemberInfo = new StringBuilder();
        string strFormatLeft = "<tr><td width='25%' height='28' align='left'  bgcolor='#FFFFFF'>{0}</td>";
        string strFormatRight = "<td align='left'  style='padding-left:10px;'  bgcolor='#FFFFFF'>{0}</td></tr>";

        // Methods
        private void Bind()
        {
            DataTable table = SQLAccess.GreatDs("select * from DB_Member where memberid=" +  LoginMember.MemberId.ToString() + "").Tables[0];
            if (table.Rows.Count > 0)
            {
                StrMemberInfo.Append(string.Format(strFormatLeft, "登录用户名"));
                StrMemberInfo.Append(string.Format(strFormatRight, table.Rows[0]["loginName"].ToString()));

                StrMemberInfo.Append(string.Format(strFormatLeft, "真实姓名"));
                StrMemberInfo.Append(string.Format(strFormatRight, table.Rows[0]["membername"].ToString()));

                StrMemberInfo.Append(string.Format(strFormatLeft, "手机"));
                StrMemberInfo.Append(string.Format(strFormatRight, table.Rows[0]["phone"].ToString()));

                StrMemberInfo.Append(string.Format(strFormatLeft, "联系电话"));
                StrMemberInfo.Append(string.Format(strFormatRight, table.Rows[0]["tel1"].ToString()));

                StrMemberInfo.Append(string.Format(strFormatLeft, "邮政编码"));
                StrMemberInfo.Append(string.Format(strFormatRight, table.Rows[0]["post"].ToString()));

                StrMemberInfo.Append(string.Format(strFormatLeft, "联系地址"));
                StrMemberInfo.Append(string.Format(strFormatRight, table.Rows[0]["address"].ToString()));

                StrMemberInfo.Append(string.Format(strFormatLeft, "QQ"));
                StrMemberInfo.Append(string.Format(strFormatRight, table.Rows[0]["qq"].ToString()));

                StrMemberInfo.Append(string.Format(strFormatLeft, "E-Mail"));
                StrMemberInfo.Append(string.Format(strFormatRight, table.Rows[0]["email"].ToString()));



            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                if (LoginMember != null)
                {
                    this.Bind();
                }     
                else
                {
                    base.Response.Write("<script language=javascript>window.location.href='index.aspx';</script>");
                    base.Response.End();
                }
            }
        }

       

    }
}